package com.company.tx2021;

import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main4 {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        int n = sc.nextInt();
        int[] num = new int[n];
        int[] num_copy = new int[n];
        for (int i = 0; i < n; i++) {
            num[i] = sc.nextInt();
            num_copy[i] = num[i];
        }
        Arrays.sort(num_copy);
        Map<Integer,Integer> pos = new HashMap<>();
        for (int i = 0; i < n; i++) {
            pos.put(num_copy[i],i);
        }
        int mid = n >> 1;
        int pre = num_copy[mid];
        int nex = num_copy[mid - 1];
        for (int i = 0; i < n; i++) {
            int temp = num[i];
            int index = pos.get(temp);
            if(index < mid){
                System.out.println(pre);
            }else{
                System.out.println(nex);
            }
        }

    }
}
